import axios from "axios";
// @ts-ignore
import  {LoginFrom} from "@/types/global.ts";

export const login = (data:LoginFrom)=>{
    return axios.post('/sys/login',data)
}
export const exitLogin = ()=>{
    return axios.get('/sys/logout')
}
export const getCaptcha = ()=>{
    return axios.get('/sys/getCaptcha')
}
export const queryMenuTree = ()=>{
    return axios.get('/sys/menu/menuTree')
}
export const uploadFile = (file:File)=>{
    const formData = new FormData();
    formData.append("file",file)
    return axios.post("/common/uploadFile",formData,
        {
            headers:{
                "Content-Type":'multipart/form-data'
            }
        })
}